<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="utf-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%><%@ taglib uri="http://tiles.apache.org/tags-tiles" prefix="tiles"%>
<tiles:insertDefinition name="layout">
	<tiles:putAttribute name="head">

		<script type="text/javascript">
			$(function() {
				$(".confirm").confirmDialog(function(data) {
					helper.showMsg(data, {
						okHandler : function() {
							location.reload();
						}
					});
				});

				$(".dialog").frameDialog({
					width : 500,
					height : 300,
					close : function() {
						if (art.dialog.data("success")) {
							location.reload();
						}
					}
				});
			});
		</script>
	</tiles:putAttribute>
	<tiles:putAttribute name="mainBody">
		<ul class="breadcrumb">
			<li><s:url action="createCourse" namespace="/course" id="createCourse">
				</s:url> <a class="dialog" href="${createCourse}">创建课程</a><span class="divider">/</span></li>
			<li class="active">课程列表</li>
		</ul>
		<table class="table">
			<thead>
				<tr>
					<th>名称</th>
					<th>操作</th>
				</tr>
			</thead>
			<tbody>
				<s:iterator value="courses" var="course">
					<tr>
						<td><s:url id="modifyCourse" action="modifyCourse" namespace="/course">
								<s:param name="id" value="id"></s:param>
							</s:url> <a href="${modifyCourse}" class="dialog"> ${course.name}(${course.title})</a></td>
						<td><s:url id="doRemoveCourse" action="doRemoveCourse" namespace="/course">
								<s:param name="id" value="id"></s:param>
							</s:url> <a class="confirm" href="${doRemoveCourse}" title="删除该用户">删除</a></td>
					</tr>
				</s:iterator>
			</tbody>
		</table>
	</tiles:putAttribute>
</tiles:insertDefinition>